package week3;

import java.util.Scanner;

public class q2 {
    public static void main(String[] args){
        int random = (int)(Math.random()*100);
        int guess;
        Scanner sc = new Scanner(System.in);
        while(true){
            System.out.println("Please enter a number between 1 and 100");
            guess = sc.nextInt();
            if (guess==random){
                System.out.println("You guessed it!");
                break;
            }else if(guess<random){
                System.out.println("小了");
            }else{
                System.out.println("大了");
            }
        }
    }
}

